Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoc-gen-go-grpc: add requirement of embedding UnimplementedServer in services #3657

Merged
merged 8 commits into from
Jun 4, 2020

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Jun 1, 2020

No description provided.

@dfawley dfawley added Type: Feature New features or improvements in behavior no release notes labels Jun 1, 2020
@dfawley dfawley requested a review from menghanl June 1, 2020 21:54
Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 14 of 30 files at r1, 17 of 17 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dfawley)


cmd/protoc-gen-go-grpc/grpc.go, line 142 at r2 (raw file):

	}
	if *requireUnimplemented {
		g.P("unimplemented", serverType, "()")

Is there a better name so that the compilation error also serves as documentation?
requireUnimplementedXXX()?
needsToEmbedUnimplementedXXX()?

@dfawley
Copy link
Member Author

dfawley commented Jun 2, 2020

Good idea. I went with mustEmbedUnimplementedFooServer. PTAL.

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 17 of 17 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dfawley)

type LoadBalancerServer interface {
// Bidirectional rpc to get a list of servers.
BalanceLoad(LoadBalancer_BalanceLoadServer) error
mustEmbedUnimplementedLoadBalancerServer()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we said we want to revert the changes to the generated code, because they are API changes.

files for gRPC. For usage information, please see our [quick start
guide](https://grpc.io/docs/languages/go/quickstart/).

By default, to register services using the methods generated by this tool, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to a separate section?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


This tool generates Go language bindings of `service`s in protobuf definition
files for gRPC. For usage information, please see our [quick start
guide](https://grpc.io/docs/languages/go/quickstart/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick start doesn't have examples for using this plugin (yet?)

Even if it does, it would be helpful to have a copy-paste ready command here?
Or point to https://github.com/grpc/grpc-go/blob/master/regenerate.sh#L60

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is very much a work in progress. Let's make incremental progress on it until we eventually release the tool at 1.0.

@dfawley dfawley changed the title protoc-gen-go-grpc: add requirement of embedding Unimplemented___Server in services protoc-gen-go-grpc: add requirement of embedding UnimplementedServer in services Jun 4, 2020
@dfawley dfawley merged commit ad51f57 into grpc:master Jun 4, 2020
@dfawley dfawley deleted the protoc-unimpl branch June 4, 2020 17:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants